package cn.ctbu.xiaopeng.studentscoremanage.exception;


import cn.ctbu.xiaopeng.studentscoremanage.enums.ResultEnum;
import lombok.Getter;
import lombok.Setter;

/**
 * @author xiaopeng
 * @version 1.0
 */
@Getter
@Setter
public class ResultException extends RuntimeException {
    private Integer code;

    public ResultException(Integer code, String msg) {
        super(msg);
        this.code = code;
    }

    public ResultException(String msg) {
        super(msg);
    }


    public ResultException(ResultEnum resultEnum) {
        super(resultEnum.getMsg());
        this.code = resultEnum.getCode();
    }

}
